<template>
    <div>
        <h2>门店列表</h2>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>Id</td>
                    <td>图片</td>
                    <td>门店名称</td>
                    <td>分店名称</td>
                    <td>地址</td>
                    <td>电话</td>
                    <td>介绍</td>
                    <td>须知</td>
                    <td>操作</td>
                </tr>
                <tr v-for="item in list">
                    <td>{{ item.Id }}</td>
                    <td></td>
                    <td>{{ item.ShopName }}</td>
                    <td>{{ item.BranchName }}</td>
                    <td>{{ item.AddressName }}</td>
                    <td>{{ item.Phone }}</td>
                    <td>{{ moment(item.CreateTime).format('YYYY-MM-DD HH:mm:ss')}}</td>
                    <td>{{ item.Decs }}</td>
                    <td>{{ item.Inton }}</td>
                    <td>
                        <input type="button" value="修改/编辑" class="btn btn-primary"></input>
                        <input type="button" value="删除" class="btn btn-danger"></input>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue'
import {useRouter,useRoute} from 'vue-router'
import axios from 'axios';
import moment from 'moment';

const router = useRouter()
const route = useRoute()

let list:any = ref([]);

onMounted(()=>{
    GetShopList();
});

const GetShopList=()=>{
    axios({
        url:'/api/Shops/GetShopList',
        method:'get'
    })
    .then((res)=>{
        console.log(res);
        list.value = res.data
    })
    .catch((err)=>{
        console.log(err)
    })
}
</script>

<style scoped>

</style>